Focus control device, non-transitory computer readable recording medium having therein program for focus control, and method for focus control

ABSTRACT

A focus control device includes an acquisition unit that acquires image data of a plurality of first frames, each of the plurality of first frames being captured at each of positions of a lens in an optical axis direction, the positions being different each other; and a movement unit that, when a focusing position of the lens is not determined based on contrast evaluation values for an area to be focused on in the plurality of first frames, determines a direction for moving the area, based on a magnitude of a contrast evaluation value within the area and a position of an area with the contrast evaluation value larger than or equal to a given threshold in each piece of image data of the plurality of first frames or a plurality of second frames newly acquired by the acquisition unit, and moves the area in the determined direction.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based upon and claims the benefit of priority of theprior Japanese Patent Application No. 2014-241124, filed on Nov. 28,2014, the entire contents of which are incorporated herein by reference.

FIELD

The embodiment discussed herein is related to a focus control device, anon-transitory computer readable recording medium having therein a focuscontrol program, and a method for focus control.

BACKGROUND

There is a technique for performing focus control that repeats aprocedure of acquiring image data and computing a contrast value fromthe acquired image data, while moving the position of a lens, so as tomove the lens to a position at which the contrast value peaks. There isanother technique for performing focus control that increases the areaof an area to be focused on when a peak of the contrast value is notdetected in the area to be focused on because high-frequency componentsare insufficient. There is another technique for performing focuscontrol in which, when a peak of the contrast value is not detected in afirst area, a peak of the contrast value is attempted to be detected ina second area with the largest contrast value. There is anothertechnique, in which the position of the main subject being imaged isroughly detected by multipoint distance measurement, and image analysisis performed with respect to the detected position of the main subject,so that the position of the subject being imaged is detected and focuscontrol is performed even when the main subject is present at a positionother than the center of a frame.

Examples of the relate-art techniques include Japanese Laid-open PatentPublication No. 3-261277, Japanese Laid-open Patent Publication No.4-267210, Japanese Laid-open Patent Publication No. 62-182704, andJapanese Laid-open Patent Publication No. 2012-123324.

SUMMARY

According to an aspect of the invention, a focus control deviceincludes: an acquisition unit that acquires image data of a plurality offirst frames, each of the plurality of first frames being captured ateach of positions of a lens in an optical axis direction, the positionsbeing different each other; and a movement unit that, when a focusingposition of the lens is not determined based on contrast evaluationvalues for an area to be focused on in the plurality of first frames,determines a direction for moving the area to be focused on, based on amagnitude of a contrast evaluation value within the area to be focusedon and a position of an area with the contrast evaluation value largerthan or equal to a given threshold in each piece of image data of theplurality of first frames or a plurality of second frames newly acquiredby the acquisition unit, and moves the area to be focused on in thedetermined direction.

The object and advantages of the invention will be realized and attainedby means of the elements and combinations particularly pointed out inthe claims.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary and explanatory and arenot restrictive of the invention, as claimed.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example of principal functionsof a smart device according to an embodiment;

FIG. 2 is a block diagram illustrating an example of a configuration ofan electrical system of the smart device according to the embodiment;

FIG. 3 is a conceptual diagram depicting an example of an imageacquisition area and an area to be focused on according to theembodiment;

FIG. 4 is a flowchart illustrating an example of a focus control processaccording to the embodiment;

FIG. 5 is a flowchart illustrating an example of a process of computinga contrast value according to the embodiment;

FIG. 6 is a flowchart illustrating an example of a process of detectingan object according to the embodiment;

FIG. 7A is a graph depicting an example of contrast values according tothe embodiment;

FIG. 7B is a graph depicting an example of contrast values according tothe embodiment;

FIG. 7C is a graph depicting an example of contrast values according tothe embodiment;

FIG. 8 is a conceptual diagram depicting an example of an imageacquisition area according to the embodiment;

FIG. 9 is a conceptual diagram depicting an example of an area to befocused on according to the embodiment;

FIG. 10 is a conceptual diagram depicting an example of the imageacquisition area according to the embodiment;

FIG. 11 is a conceptual diagram depicting an example of the area to befocused on according to the embodiment;

FIG. 12 is a flowchart illustrating an example of a process ofperforming outdoor determination according to the embodiment;

FIG. 13 is a flowchart illustrating an example of a process of changingan area to be focused on according to the embodiment;

FIG. 14 is a flowchart illustrating an example of a process of computingan object direction according to the embodiment;

FIG. 15 is a conceptual diagram illustrating an example of division ofan area to be focused on according to the embodiment;

FIG. 16 is a conceptual diagram illustrating an example of movement ofan area to be focused on according to the embodiment;

FIG. 17 is a conceptual diagram illustrating an example of movement ofthe area to be focused on according to the embodiment; and

FIG. 18 is a conceptual diagram illustrating an example of enlargementof the area to be focused on according to the embodiment.

DESCRIPTION OF EMBODIMENT

With the related-art techniques, when a peak of the contrast value isnot detected within the initial area to be focused on, the area of thearea to be focused on is increased or the position of the area to befocused on is moved. However, there is a possibility in the related-arttechniques that, when the area of the area to be focused on increases,the load due to a focus control process increases with the enlargementof the area to be processed. In addition, when the position of the areato be focused on is moved, image data outside the current area to befocused on is used for determination of the destination, and thus thearea to be processed enlarges, resulting in an increase in theprocessing load.

It is desired to reduce the load of a focus control process performedwhen the focusing position of a lens is not determined from contrastevaluation values for an area to be focused on.

Hereinafter, an example of an embodiment of the technique of the presentdisclosure will be described in detail with reference to theaccompanying drawings. It is to be noted that, although the case inwhich a smart device, as an example of a focus control device accordingto the technique of the present disclosure, is used will be described byway of example, the technique of the present disclosure is not limitedto this. The technique of the present disclosure is applicable to, forexample, a compact digital camera with which the user performs an imagecapture operation while holding the camera by hand, so that an image isacquired, as well as the smart device.

A smart device 10 illustrated in FIG. 1, by way of example, includes anacquisition unit 12, a movement unit 16, and an outdoor determinationunit 18. The acquisition unit 12, the movement unit 16, and the outdoordetermination unit 18 are mutually coupled. The acquisition unit 12acquires image data of a plurality of first frames differing in theposition of a lens in the optical axis direction. When the focusingposition of a lens is not determined based on the contrast evaluationvalues for an area to be focused on in the plurality of first frames,the movement unit 16 determines a direction for moving the area to befocused on and moves the area to be focused on in the determineddirection. The direction for moving the area to be focused on isdetermined based on the magnitude of a contrast evaluation value withinthe area to be focused on and the position of an area with a contrastevaluation value larger than or equal to a given threshold in each pieceof image data of the plurality of first frames. Alternatively, thedirection for moving the area to be focused on is determined based onthe magnitude of a contrast evaluation value within the area to befocused on and the position of an area with a contrast evaluation valuelarger than or equal to a given threshold in each piece of image data ofa plurality of second frames newly acquired by the acquisition unit 12.

The smart device 10 includes, as illustrated in FIG. 2 by way ofexample, a central processing unit (CPU) 60, a primary storage unit 62,a secondary storage unit 64, an external interface 70, a touch paneldisplay 74, a camera 76, a photometry sensor 78, and an accelerationsensor 79. The touch panel display 74 includes a touch panel 74A and adisplay 74B. The camera 76 includes an image acquisition unit 76Aincluding an image sensor such as a charge-coupled device (CCD) or acomplementary metal oxide semiconductor (CMOS), a lens 76C, and a lensdrive unit 76B that moves the lens 76C in the optical axis direction.The CPU 60, the primary storage unit 62, the secondary storage unit 64,the external interface 70, and the touch panel display 74 are mutuallycoupled via a bus 80.

The touch panel 74A detects a touch operation performed thereon. Thedisplay 74B displays an image acquired or the like. The imageacquisition unit 76A acquires image data. The lens drive unit 76Bincludes, for example, a stepping motor or the like and moves the lens76C in the optical axis direction in a range including a plurality ofstages between a macro end and an infinity end. The photometry sensor 78detects the luminance of a subject being imaged. The acceleration sensor79 detects a gravitational acceleration direction. The externalinterface 70 is coupled to an external device and is in charge oftransmitting and receiving various kinds of information between theexternal device and the CPU 60.

The primary storage unit 62 is, for example, a volatile memory such as arandom access memory (RAM). The secondary storage unit 64 is, forexample, a nonvolatile memory such as a hard disk drive (HDD) or a solidstate drive (SSD).

The secondary storage unit 64 stores, by way of example, a focus controlprogram 66 including an acquisition subprogram 66A, a movementsubprogram 66B, and an outdoor determination subprogram 66C. The CPU 60sequentially reads the acquisition subprogram 66A, the movementsubprogram 66B, and the outdoor determination subprogram 66C from thesecondary storage unit 64 and loads the subprograms into the primarystorage unit 62.

The CPU 60 operates as the acquisition unit 12 illustrated in FIG. 1 byexecuting the acquisition subprogram 66A. The CPU 60 operates as themoving unit 16 illustrated in FIG. 1 by executing the movementsubprogram 66B. The CPU 60 operates as the outdoor determination unit 18illustrated in FIG. 1 by executing the outdoor determination subprogram66C. Note that the focus control program 66 is an example of the focuscontrol program according to the technique of the present disclosure.

FIG. 3 depicts an example of an image acquisition area 30 according tothe present embodiment. The image acquisition area 30 is the area of aframe captured by an image sensor. The image acquisition area 30 isdivided into a grid pattern in which a plurality of areas are providedin each of the vertical direction and the horizontal direction. Here,the example in which the image acquisition area 30 is dividedhorizontally into five columns, 1 to 5, and vertically into five rows, Ato E, is presented. That is, the image acquisition area 30 is dividedinto 5×5 areas, that is, c25 areas. For example, a central areasurrounded by a bold line is a C-th row and third column area, which isreferred to as an area C3 hereinafter. In this embodiment, the area C3is an area to be focused on in the initial setting. The area to befocused on is a partial area of an image acquisition area and is an areaused for focusing.

Next, a focus control process performed by the smart device 10 when theCPU 60 executes the focus control program 66, as operations of thepresent embodiment, will be described with reference to FIG. 4.

The focus control process is started, for example, by the user tapping acapture start button or the like, which is not illustrated in thedrawings, displayed on the touch panel display 74 of the smart device10.

In step 102 in FIG. 4, the CPU 60 starts a process of computing acontrast value (hereinafter referred to as a contrast value computingprocess), the details of which are illustrated in FIG. 5. In step 202 inFIG. 5, the CPU 60 moves the lens 76C to the macro end by using the lensdrive unit 76B. In step 204, the CPU 60 acquires image data of the areato be focused on C3 by using the image acquisition unit 76A. Note thatimage data acquired here is an example of image data of a plurality offirst frames. Image data corresponding to one frame including the areato be focused on C3 may be acquired.

In step 206, the CPU 60 computes the contrast value of image dataacquired in step 204. The contrast value is computed, for example, byformula (1) in which a ratio of the difference between a maximumluminance value and a minimum luminance value to the sum of the maximumluminance value and the minimum luminance value is expressed. In formula(1), Lmax is the maximum luminance value and Lmin is the minimumluminance value. A luminance value L is computed by formula (2), where Ris the red component of a pixel value, G is the green component of thepixel value, and B is the blue component of the pixel value.Contrast value=(Lmax−Lmin)/(Lmax+Lmin)  (1)Luminance value L=0.299R+0.587G+0.114B  (2)

Note that the contrast evaluation value in the technique of the presentdisclosure is not limited to the contrast value mentioned above. Forexample, the contrast evaluation value may be another evaluation valuein correlation with the contrast value, in particular, the sharpness orthe like.

In step 208, the CPU 60 moves the lens 76C by an amount corresponding toa given number of stages from the macro end toward the infinity end byusing the lens drive unit 76B. In step 210, the CPU 60 determineswhether or not the lens 76C has been moved by an amount corresponding tothe number of stages from the macro end to the infinity end. When thedetermination is negative, the CPU 60 returns to step 204 and repeatsprocessing from step 204 to step 210 until the lens 76C reaches theinfinity end. In step 208, the number of states by which the lens 76C ismoved is set so that, for example, image data of 15 frames is able to beacquired until the lens 76C reaches the infinity end. As a result of theabove, the lens 76C is moved by a given number of stages from the macroend to the infinity end, and the contrast value is computed each timethe lens 76C is moved.

In step 210, when the CPU 60 determines that the lens 76C has been movedto the infinity end, the CPU 60 completes the contrast value computingprocess and proceeds to step 104 in FIG. 4.

In step 104 in FIG. 4, from the contrast value of image data of the areato be focused on that is computed in step 206 in FIG. 5, a peak of thecontrast value obtained as the lens position moves is detected by usinga hill-climbing method. When a peak is detected in step 104, then, instep 106, the lens 76C is driven by using the lens drive unit 76B so asto be moved to a position at which the peak has been detected. Thus, thefocus control process ends.

FIG. 7A to FIG. 7C illustrate graphs in which the vertical axisrepresents the contrast and the horizontal axis represents the lensposition. As illustrated in FIG. 7A, when a peak of the contrast ispresent at a lens position X, the CPU 60 moves the lens 76C to the lensposition X by using the lens drive unit 76B and then completes the focuscontrol process.

On the other hand, when a peak is not detected in step 104, the CPU 60proceeds to step 108, where a process of detecting an object(hereinafter referred to as an object detection process), the details ofwhich are illustrated in FIG. 6, is performed. For example, when a peakof the contrast value is not present as depicted in FIG. 7B, and when aplurality of peaks of contrast values are present as depicted in FIG. 7Cand it is not possible to determine what peak is an appropriate peak,the CPU 60 executes the object detection process. Details of the objectdetection process are illustrated in FIG. 6.

In step 302 of FIG. 6, the CPU 60 moves the lens 76C to a predeterminedposition by using the lens drive unit 76B and then stops the lens 76C atthe predetermined position. The predetermined position is, for example,a lens position at which an object present at a position apart therefromby 1 meter is focused on. The predetermined position is computed inadvance by a lens image formation formula. In step 304, the CPU 60acquires image data of the area to be focused on C3, which is an initialarea to be focused on, by using the image acquisition unit 76A. In step306, the CPU 60 computes the contrast value of the area to be focused onC3. In step 307, the CPU 60 counts the number of frames of the acquiredimage data, and, in step 308, the CPU 60 determines based on the countobtained in step 307 whether or not image data of the area to be focusedon C3 the amount of which exceeds a predetermined number of frames hasbeen acquired in step 304. When it is determined, in step 308, thatimage data of the area to be focused on C3 the amount of which exceedsthe predetermined number has not been acquired, the CPU 60 returns tostep 304 and repeats processing of step 304 to step 308. Thepredetermined number of frames may be, for example, 15. Note that imagedata acquired here is an example of image data of a plurality of secondframes.

When it is determined, in step 308, that image data the amount of whichexceeds the predetermined number of frames has been acquired, the CPU 60proceeds to step 310, where the CPU 60 selects a frame with the largestcontrast value among image data acquired in step 304. In step 312, theCPU 60 determines whether or not the contrast value in the frameselected in step 310 is larger than or equal to a given threshold. When,in step 312, it is determined that the contrast value is larger than orequal to the given threshold, an object available for focusing ispresent. Thus, in step 316, the CPU 60 sets a detection flag to one andcompletes the object detection process and then proceeds to step 110illustrated in FIG. 4.

When, in step 312, it is determined that the contrast value is less thana given threshold, an object available for focusing is not present.Thus, in step 314, the CPU 60 sets the detection flag to zero andcompletes the object detection process and then proceeds to step 110 inFIG. 4. The threshold may be, for example, 0.4; however, the techniqueof the present disclosure is not limited to this.

The present embodiment is applied to the case where the user holds thesmart device 10 by hand while image data of the initial area to befocused on is acquired in step 204 of the contrast value computingprocess and in step 304 of the object detection process. When the userattempts to acquire image data of a landscape depicted in FIG. 8, imagedata of the area to be focused on C3 varies because of hand-held camerashake as depicted in frame 1 to frame 15 in FIG. 9 even when the userdoes not consciously move his hand. For example, in frame 2 to frame 6depicted in FIG. 9, image data of an object (an upper end corner portionof a multistoried building) enters the area to be focused on C3 at thebottom right corner thereof. Here, the contrast value of image data offrame 4 depicted in FIG. 9 is largest, and frame 4 depicted in FIG. 9 isselected in step 310. When the contrast value is larger than or equal tothe given threshold, the detection flag is set to one in step 316. Whenthe contrast value is less than the given threshold, the detection flagis set to zero in step 314.

When the user attempts to acquire image data of a landscape exemplifiedin FIG. 10, image data of the area to be focused on C3 does not varywhen a hand-held camera shakes, as exemplified in frame 1 to frame 15 inFIG. 11. That is, in frame 1 to frame 15 in FIG. 11, image data of anobject does not enter the area to be focused on C3. This is becausethere is no object near a portion of the landscape corresponding to thearea to be focused on C3. Here, the contrast value of image data in anyframe is less than the given threshold, and the detection flag is set tozero in step 314.

In step 110 in FIG. 4, the CPU 60 determines whether the detection flagis zero or one. It is determined that the detection flag is zero, theCPU 60 proceeds to steps 112, where the CPU 60 executes a process ofperforming outdoor determination (hereinafter referred to as an outdoordetermination process), the details of which are illustrated in FIG. 12.In step 402 in FIG. 12, the CPU 60 computes a subject luminance value BVbased on the luminance of a subject being imaged, the luminance of thesubject being detected by the photometry sensor 78.

In step 404, the CPU 60 determines whether or not the subject luminancevalue BV is larger than or equal to a given threshold. When, in step404, it is determined that the subject luminance value BV is larger thanor equal to the given threshold, then the CPU 60 determines, in step406, that image data of the area to be focused on C3 is outdoor imagedata, sets the determination flag to one and completes the outdoordetermination process. Then, the CPU 60 proceeds to step 114 in FIG. 4.When, in step 404, it is determined that the subject luminance value BVis less than the given threshold, then, the CPU 60 determines, in step408, that image data of the area to be focused on C3 is indoor imagedata, sets the determination flag to zero and completes the outdoordetermination process and then proceeds to step 114 in FIG. 4. The giventhreshold may be, for example, five.

In step 114 in FIG. 4, the CPU 60 determines whether the determinationflag is zero or one. When, in step 114, it is determined that thedetermination flag is one, then, in step 116, the CPU 60 sets thedirection of an object (hereinafter referred to as an object direction)to a gravitational acceleration direction detected by the accelerationsensor 79 (hereinafter, the gravitational acceleration direction isreferred to as a downward direction for the sake of convenience, andother directions are described with respect to the downward direction)and proceeds to step 122, where the CPU 60 executes a process ofchanging an area to be focused on, the details of which are illustratedin FIG. 13. When an object is not detected in an area to be focused onout of doors, the image data in question is highly likely to correspondto the sky. In that case, an object available for focusing is highlylikely to be present in an area positioned below the area to be focusedon, that is, an area present in the gravitational acceleration directionof the subject. Thus, as described below, the area to be focused on ismoved in the downward direction within the image acquisition area 30.

When, in step 114, it is determined that the determination flag is zero,then, in step 118, the CPU 60 sets the object direction to null,proceeds to step 122, and executes the process of changing an area to befocused on, the details of which are illustrated in FIG. 13. When anobject is not detected in an area to be focused on in the doors, it isunclear where an object available for focusing is highly likely to bepresent. Thus, as described below, the area to be focused on is notmoved and the area of the area to be focused on is increased. This isbecause increasing the area of the area to be focused on increases thelikelihood that image data corresponding to an object available forfocusing is included in the image data of the area to be focused on.

The processing in step 110 illustrated in FIG. 4 will be describedagain. When, when the CPU 60 determines whether the detection flag iszero or one, it is determined that the detection flag is one, the CPU 60proceeds to step 120, where the CPU 60 executes a process of computingan object direction, the details of which are illustrated in FIG. 14.

In step 502 in FIG. 14, the CPU 60 divides the area to be focused on C3into a plurality of areas of 3×3 as illustrated in FIG. 15. In step 504,the CPU 60 computes the contrast value of image data corresponding to anarea denoted by (2) in FIG. 15. In step 506, the CPU 60 determineswhether or not all the contrast values of 8 areas (2) to (9) other thanthe center area denoted by (1) have been computed. When, in step 506, itis determined that all the contrast values of eight areas other than thecenter area (1) have not been computed, the CPU 60 returns to step 504and repeats the processing of step 504 and step 506 until all thecontrast values of areas (2) to (9) have been computed.

When, in step 506, it is determined that all the contrast values ofareas (2) to (9) have been computed, then, in step 508, the CPU 60 setsa direction from the center of the area to be focused on C3 toward anarea with the largest contrast value as the object direction andproceeds to step 122 in FIG. 4, where the CPU 60 executes the process ofchanging an area to be focused on, the details of which are illustratedin FIG. 13.

In image data exemplified in frame 4 in FIG. 9 selected in step 310,area (6) has the largest contrast value, and thus a direction to area(6) is set as the object direction. When area (6) at the bottom rightcorner of the area to be focused on C3 has the largest contrast value,an object available for focusing is highly likely to be present in anarea D4 that is present diagonally right downward of the area to befocused on C3. Thus, as described below, the area to be focused on ismoved in a diagonally right downward direction.

In step 602 in FIG. 13, the CPU 60 determines whether or not the objectdirection is null. When, in step 602, it is determined that the objectdirection is not null, then, in step 604, the CPU 60 moves the area tobe focused on in a direction set as the object direction, and then, instep 124 in FIG. 4, executes the contrast value computing process, thedetails of which are illustrated in FIG. 5.

For example, when, in step 116, the downward direction is set as theobject direction, the area to be focused on moves from the area C3 to anarea D3 as depicted in FIG. 16.

For example, when, in step 508, the diagonally right downward directionis set as the object direction, the area to be focused on moves from thearea C3 to an area D4 as depicted in FIG. 17.

When, in step 602, it is determined that the object direction is null,then, in step 606, as depicted in FIG. 18, the CPU 60 enlarges the areato be focused on from the area C3 to a rectangular area including areasB2, B3, B4, C2, C3, C4, D2, D3, and D4. Next, in step 124 in FIG. 4, theCPU 60 executes the contrast value computing process, the details ofwhich are illustrated in FIG. 5.

The contrast value computing process in step 124 has been describedabove, and thus details thereof will be omitted. Upon completion of thecontrast value computing process, the CPU 60, in step 106, drives thelens 76C by using the lens drive unit 76B, so that the lens 76C moves toa position at which the contrast value peaks, and completes the focuscontrol process.

In the technique of the present disclosure, image data of a plurality offirst frames including frames in accordance with positions of a lensmoving in the optical axis direction is acquired. Additionally, in thetechnique of the present disclosure, when the focusing position of alens is not determined based on the contrast values for an area to befocused on in the plurality of first frames, image data of a pluralityof second frames is acquired. Additionally, in the technique of thepresent disclosure, the direction in which the area to be focused on ismoved is determined based on the magnitude of the contrast value for thearea to be focused on and the contrast position of the area to befocused on in each of the plurality of second frames, and the area to befocused on is moved in the determined direction. Thus, in the techniqueof the present disclosure, even when the focusing position of a lens isnot determined based on the contrast values for the area to be focusedon in the plurality of first frames, the area to be focused on may bemoved to an area where image data corresponding to an object availablefor focusing is highly likely to be present. Here, image data outsidethe area to be focused on is not used. Accordingly, the load caused bythe focus control process may be reduced.

In the technique of the present disclosure, when an area with a contrastvalue exceeding a threshold is not detected from areas (2) to (9) withinthe area to be focused on, the position of the area to be focused on ismoved in the downward direction of the area to be focused on when imagedata of the area to be focused on is outdoor image data. Thus, in thetechnique of the present disclosure, when it is unclear which of areas(2) to (9) within the area to be focused on is an area where image datacorresponding to an object available for focusing is present, the areato be focused on may be moved in a direction in which image datacorresponding to an object available for focusing is highly likely to bepresent. Accordingly, the load caused by the focus control process maybe reduced.

In the technique of the present disclosure, when the image data of thearea to be focused on described above is not outdoor image data, thearea of the area to be focused on is increased. Thus, in the techniqueof the present disclosure, when the position of an area where image datacorresponding to an object available for focusing for the existing areato be focused on is present is unclear, the image data corresponding toan object available for focusing may be included in an enlarged area tobe focused on. Accordingly, the load caused by the focus control processmay be reduced.

Note that, in the above, the manner in which the focus control program66 is stored (installed) in advance in the secondary storage unit 64 hasbeen described. However, the focus control program 66 may be provided ina manner in which it is recorded on a non-transitory recording mediumsuch as a compact disc read-only memory (CD-ROM) or a digital videodisc-ROM (DVD-ROM). In addition, the focus control program 66 may bestored in a remote server. For example, a smart device may receive aresult of execution of the focus control program 66 stored in a remoteserver via a communication line such as the Internet.

Note that, in the above embodiment, the image acquisition area 30 isdivided into areas in a grid pattern of 5×5 as depicted in FIG. 3;however, the technique of the present disclosure is not limited to this.For example, the image acquisition area 30 may be divided into areas ina grid pattern of 6×6, or may be divided into areas in a grid pattern of16×16.

Note that, in the above embodiment, the initial area to be focused on isset to the area C3 depicted in FIG. 3; however, the technique of thepresent disclosure is not limited to this. For example, a rectangulararea including areas B2, B3, B4, C2, C3, C4, D2, D3, and D4 may be usedas the area to be focused on.

Note that, in the above embodiment, the case where the lens 76C is movedfrom the macro end to the infinity end in the contrast value computingprocess illustrated in FIG. 5 has been described; however, the techniqueof the present disclosure is not limited to this. For example, when thecurrent position of the lens 76C is close to the infinity end, the lens76C may be moved from the infinity end to the macro end. Additionally,the lens 76C starts moving from one end position toward the other endposition, and, when a peak of the contrast value that may be determinedas the focusing position is detected, the movement of the lens 76Ctoward the other end position may be stopped and the lens 76C is movedtoward the focusing position.

Note that, in the above embodiment, in the contrast value computingprocess illustrated in FIG. 5, image data of an area to be focused on isacquired and then the lens 76C is moved; however, the technique of thepresent disclosure is not limited to this. After the lens 76C is moved,image data of an area to be focused on may be acquired.

Note that image data for the area to be focused on in frame 1 to frame15 depicted in FIG. 9 may be captured so that an object enters the areato be focused on when a camera held by a hand of the user shakes.However, the technique of the present disclosure is not limited to this.For example, image data may be captured so that an object enters thearea to be focused on, for example, in a way that, for the purpose ofmoving the area to be focused on, the user moves his hand finely whileintentionally holding a smart device so that an object enters the areato be focused on.

Note that, in the above embodiment, the outdoor determination processexemplified in FIG. 12 is executed using the subject luminance value BV;however, the technique of the present disclosure is not limited to this.For example, using a typical sky detection algorithm or a blue-skydetection algorithm, it may be determined that image data of an area tobe focused on is image data corresponding to the sky or blue sky.

Note that, in the above embodiment, in step 604 in FIG. 13, the examplewhere the area to be focused on is moved by an amount corresponding tothe height of the row or the width of the column used for dividing thearea to be focused on has been described as exemplified in FIG. 16 andFIG. 17; however, the technique of the present disclosure is not limitedto this. For example, the area to be focused on may be moved by anamount corresponding to half the height of the row and half the width ofthe column.

Note that, in the above embodiment, in step 606, as exemplified in FIG.18, the example where the area to be focused on is enlarged by an amountcorresponding to the height of the row and the width of the column hasbeen described; however, the technique of the present disclosure is notlimited to this. For example, the height and the width by which the areato be focused on is enlarged may be half the height of the row and halfthe width of the column.

Note that, for example, the image acquisition area 30 depicted in FIG. 3may be displayed on the touch panel display 74 during the focus controlprocess. The lines indicating boundaries between rows and betweencolumns and lines indicating the area to be focused on may also bedisplayed on the touch panel display 74.

In addition, in the above, the manner in which, when, after acquisitionof the image data of a plurality of first frames, the focusing positionof a lens is not determined from contrast evaluation values, the imagedata of a plurality of second frames is acquired under the conditionwhere the lens 76C is positioned at a given location has been described.However, the technique of the present disclosure is not limited to this.Acquisition of the image data of the plurality of second frames may beomitted, and, using the image data of a plurality of first frames, theprocessing of the object detection process in step 108 in FIG. 4 andthereafter may be performed.

All examples and conditional language recited herein are intended forpedagogical purposes to aid the reader in understanding the inventionand the concepts contributed by the inventor to furthering the art, andare to be construed as being without limitation to such specificallyrecited examples and conditions, nor does the organization of suchexamples in the specification relate to a showing of the superiority andinferiority of the invention. Although the embodiment of the presentinvention has been described in detail, it should be understood that thevarious changes, substitutions, and alterations could be made heretowithout departing from the spirit and scope of the invention.

What is claimed is:
 1. A focus control device comprising: an acquisitionunit that acquires image data of a plurality of first frames, each ofthe plurality of first frames having an image acquisition area capturedby an image sensor, each of the plurality of first frames being capturedat each of one of a plurality of positions of a lens in an optical axisdirection, each of the plurality of positions being different eachother, and each image acquisition area being divided into a plurality ofareas in which a first area of each of the plurality of areas is an areato be focused on; and a movement unit that, when a focusing position ofthe lens is not successfully determined based on contrast evaluationvalues of the first area in the plurality of first frames; determines adirection for moving the area to be focused on from the first area to asecond area of the plurality of areas, the movement unit beingconfigured to determine the direction for moving the area to be focusedon based on: a magnitude, of a contrast evaluation value of a sub-areaof the first area, being larger than or equal to a given threshold ineach piece of image data of the plurality of first frames or a pluralityof second frames newly acquired by the acquisition unit; and a positionof the sub-area within the first area with respect to a center portionof the first area such that the determined direction corresponds to theposition of the sub-area with respect to the center portion of the firstarea; and moves the area to be focused on in the determined direction,the second area being in the determined direction from the first areasuch that the second area includes the area to be focused on.
 2. Thefocus control device according to claim 1, further comprising an outdoordetermination unit that, when the direction for moving the area to befocused on is not determined by the movement unit, determines whether ornot image data of the area to be focused on is outdoor image data,wherein, when the outdoor determination unit determines that the imagedata of the area to be focused on is outdoor image data, the movementunit moves a position of the area to be focused on in a gravitationalacceleration direction of a subject being imaged.
 3. The focus controldevice according to claim 2, wherein, when the outdoor determinationunit determines that the image data of the area to be focused on is notoutdoor image data, the movement unit increases a size of the area to befocused on such that the area to be focused on is included in aplurality of the plurality of areas.
 4. A non-transitorycomputer-readable recording medium having therein a program for causinga computer to execute a process for a focus control, the processcomprising: acquiring image data of a plurality of first frames, each ofthe plurality of first frames having an image acquisition area capturedby an image sensor, each of the plurality of first frames being capturedat each of one of a plurality of positions of a lens in an optical axisdirection, each of the plurality of positions being different eachother, and each image acquisition area being divided into a plurality ofareas in which a first area of each of the plurality of areas is an areato be focused on; and when a focusing position of the lens is notsuccessfully determined based on contrast evaluation values of the firstarea in the plurality of first frames; determining a direction formoving the area to be focused on from the first area to a second area ofthe plurality of areas, the determining being based on; a magnitude, ofa contrast evaluation value of a sub-area of the first area, beinglarger than or equal to a given threshold in each piece of image data ofthe plurality of first frames or a plurality of second frames newlyacquired by the acquisition unit; and a position of the sub-area withinthe first area with respect to a center portion of the first area suchthat the determined direction corresponds to the position of thesub-area with respect to the center portion of the first area; andmoving the area to be focused on in the determined direction, the secondarea being in the determined direction from the first area such that thesecond area includes the area to be focused on.
 5. The non-transitorycomputer-readable recording medium having therein a program for causinga computer to execute a process for a focus control according to claim4, wherein the process further comprises: when the direction for movingthe area to be focused on is not determined, determining whether or notimage data of the area to be focused on is outdoor image data, and whenit is determined that the image data of the area to be focused on isoutdoor image data, moving a position of the area to be focused on in agravitational acceleration direction of a subject being imaged.
 6. Thenon-transitory computer-readable recording medium having therein aprogram for causing a computer to execute a process for a focus controlaccording to claim 5, wherein the process further comprises when it isdetermined that the image data of the area to be focused on is notoutdoor image data, increasing a size of the area to be focused on suchthat the area to be focused on is included in a plurality of theplurality of areas.
 7. A method for a focus control, the methodcomprising: acquiring, by a computer, image data of a plurality of firstframes, each of the plurality of first frames having an imageacquisition area captured by an image sensor, each of the plurality offirst frames being captured at each of one of a plurality of positionsof a lens in an optical axis direction, each of the plurality ofpositions being different each other, and each image acquisition areabeing divided into a plurality of areas in which a first area of each ofthe plurality of areas is an area to be focused on; and when a focusingposition of the lens is not successfully determined based on contrastevaluation values of the first area in the plurality of first frames;determining a direction for moving the area to be focused on from thefirst area to a second area of the plurality of areas, the determiningbeing based on; a magnitude, of a contrast evaluation value of asub-area of the first area, being larger than or equal to a giventhreshold in each piece of image data of the plurality of first framesor a plurality of second frames newly acquired by the acquisition unit;and a position of the sub-area within the first area with respect to acenter portion of the first area such that the determined directioncorresponds to the position of the sub-area with respect to the centerportion of the first area; and moving the area to be focused on in thedetermined direction, the second area being in the determined directionfrom the first area such that the second area includes the area to befocused on.